package cn.antia.db;

import cn.antia.cep.common.AntiaLog;

/**
 * User: Jacob Xiao
 * Date: 2008-6-30
 * Time: 10:59:55
 */
public class MySQLSQLGene extends AbstractSQLGene{
    public MySQLSQLGene() {
        AntiaLog.info("MySQLSQLGene created...");
    }

    public String composeSql(String sql, String orderField, boolean isAsc, int start, int end) {
        sql = cutOrderBySql(sql);
        sql = sql + " ORDER BY " + orderField + (isAsc ? " ASC " : " DESC ") + " LIMIT " + start + "," + (end - start);
        return sql;
    }
    
}
